package com.woniu.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.woniu.common.dto.SkuOrderDto;
import com.woniu.common.dto.SkuOrderJifenDto;
import com.woniu.common.util.PageParam;
import com.woniu.common.util.ResponseData;
import com.woniu.product.pojo.TOrder;

import java.math.BigDecimal;

/**
* @author zyq
* @description 针对表【t_order(订单)】的数据库操作Service
* @createDate 2024-05-21 19:37:20
*/
public interface TOrderService extends IService<TOrder> {


    /**
     * 话费充值
     * @param phone
     * @param price
     * @param orderNum
     */
    void addRechargeOrder(String phone, BigDecimal price, Long orderNum,BigDecimal totalPrice);


    /**
     * 回滚订单
     * @param orderNum
     */
    void rollbackRechargeOrder(Long orderNum,String phone,BigDecimal price);

    /**
     * 根据订单编号查订单
     * @param orderNum
     * @return
     */
    ResponseData<?> queryOrderByOrderNum(String orderNum);


    /**
     * 查询所有订单
     * @param pageParam
     * @return
     */
    ResponseData<?> queryAllOrder(PageParam<TOrder> pageParam);

    /**
     * 修改发票状态
     * @param orderNum
     * @return
     */
    ResponseData<?> updateIsInvoiceStatus(String orderNum);

    ResponseData<?> addSkuOrder(SkuOrderDto skuOrderDto,Long orderNum);

    void rollbackSkuOrder(SkuOrderDto skuOrderDto,Long orderNum);


    ResponseData<?> updateStatus(String orderNum);

    void addJifenRechargeOrder(String phone, Integer integral, Long orderNum);

    void rollbackJifenRechargeOrder(Long orderNum, String phone, Integer integral);

    ResponseData<?> addJifenSkuOrder(SkuOrderJifenDto skuOrderDto, Long orderNum);

    void rollbackJifenSkuOrder(SkuOrderDto skuOrderDto, Long orderNum);

}
